package Calculation.L2;

import java.util.Comparator;
import java.util.PriorityQueue;

public class L2N1 {
    public static void main(String[] args) {
        Integer a[]={3,5,1,4,2};
        PriorityQueue<Integer>pq = new PriorityQueue<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });
        for (int x : a)
            pq.offer(x);
        while (!pq.isEmpty())
            System.out.printf(" %d", pq.poll());
    }
}
